package com.boot.exception;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import com.boot.communal.response.ResponseServer;

/**
 * 全局异常处理
 *
 * @author 【zhouJie】
 */
@RestControllerAdvice
public class GlobalExceptionHandler {

    //TODO 处理声明的业务异常
    @ExceptionHandler(value = BusinessException.class)
    public ResponseServer businessExceptionHandler(BusinessException e) {
        return ResponseServer.error("提示：" + e.getMessage());
    }

}
